<template>
  <div class="not-found">
    <el-empty :image-size="200">
      <template #description>
        <div class="error-text">
          <h2>404</h2>
          <p>抱歉，您访问的页面不存在</p>
        </div>
      </template>
      <el-button type="primary" @click="goHome">返回首页</el-button>
    </el-empty>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push('/')
}
</script>

<style scoped>
.not-found {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f7fa;
}

.error-text {
  text-align: center;
}

.error-text h2 {
  font-size: 48px;
  color: #409eff;
  margin-bottom: 16px;
}

.error-text p {
  font-size: 18px;
  color: #606266;
  margin-bottom: 24px;
}
</style>